/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.tradeplus.security;

import java.util.Collection;
import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;

/**
 *
 * @author ronnie
 */
public class BTPAuthenticationToken extends AbstractAuthenticationToken {
    
    String username;
    String password;
    String site;
    String domain;
    int userID;

    public BTPAuthenticationToken(String username, String password, String site, String domain) {
        super(null);
        this.username = username;
        this.password = password;
        this.site = site;
        this.domain = domain;
    }

    
    public BTPAuthenticationToken(Collection<GrantedAuthority> authorities, String username, String password, String site, String domain, int userID) {
        super(authorities);
        this.username = username;
        this.password = password;
        this.site = site;
        this.domain = domain;
        this.userID = userID;
        setAuthenticated(true);
    }

    public String getDomain() {
        return domain;
    }

    public void setDomain(String domain) {
        this.domain = domain;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSite() {
        return site;
    }

    public void setSite(String site) {
        this.site = site;
    }

    public int getUserID() {
        return userID;
    }

    public void setUserID(int userID) {
        this.userID = userID;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }
    
    @Override
    public Object getCredentials() {
        return null;
    }

    @Override
    public Object getPrincipal() {
        return userID;
    }
    
}
